<?php /* Smarty version 2.6.6, created on 2013-10-25 15:47:56
         compiled from search.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('insert', 'get_audio_categories', 'search.tpl', 70, false),array('insert', 'get_advertisement', 'search.tpl', 78, false),array('insert', 'get_seotitle_from_audioid', 'search.tpl', 120, false),array('modifier', 'stripslashes', 'search.tpl', 72, false),array('modifier', 'count', 'search.tpl', 84, false),array('modifier', 'file_exists', 'search.tpl', 122, false),array('modifier', 'truncate', 'search.tpl', 133, false),)), $this); ?>
<?php echo '
    <script type="text/javascript">
    function checkForm()
    {
        var AudioChecked = jQuery(\'input[name="audios[]"]:checked\').length;
        var PlaylistChecked = jQuery(\'input[name="playlist[]"]:checked\').length;
            if(AudioChecked<=0){
                hideAllErrors();
                jQuery("#audioError").css("display","block");
                jQuery("#audioError").focus();   
                return false;
            }else if(PlaylistChecked<=0){
                hideAllErrors();
                jQuery("#playlistError").css("display","block");    
                jQuery("#playlistError").focus();   
                return false;
            }else{
                hideAllErrors();
            }
        return true;
    
    }

    function hideAllErrors() 
    {
        jQuery("#audioError").css("display","none");
        jQuery("#playlistError").css("display","none");    
        //document.getElementById("titleError").style.display = "none"
        
    }
        
    function checkCreatePlaylist()
    {
        title = document.getElementById("playlist_title").value;

        if (title == "")
        {
            hideAllPlaylistErrors();
            document.getElementById("titleError").style.display = "block";
            document.getElementById("playlist_title").select();
            document.getElementById("playlist_title").focus();
            return false;
        } 
        /*else{
            hideAllErrors();
            jQuery(\'#create_form\').submit();
        }*/
        return true;

    }

    function hideAllPlaylistErrors() 
    {
        document.getElementById("titleError").style.display = "none"
    }    
    </script>
'; ?>

<div id="main_wrap">
    <div class="center_wrap clearfix">
        <h2 class="no_bottom no_top breadcrumb">
            <a><?php echo $this->_tpl_vars['lang796']; ?>
</a> &gt; <?php echo $this->_tpl_vars['showtitle']; ?>

        </h2>

        <div id="sidebar_wrap">
            <div id="list_cats">
                <a class="category-txt" href="<?php echo $this->_tpl_vars['baseurl']; ?>
/categories/">
                    <img alt="Category" src="<?php echo $this->_tpl_vars['baseurl']; ?>
/images/tjj_music_we_categories.jpg">
                </a>
                <ul id="ul_categories">
                    <?php require_once(SMARTY_CORE_DIR . 'core.run_insert_handler.php');
echo smarty_core_run_insert_handler(array('args' => array('name' => 'get_audio_categories', 'assign' => 'listaudiocategories')), $this); ?>

                    <?php unset($this->_sections['o']);
$this->_sections['o']['name'] = 'o';
$this->_sections['o']['loop'] = is_array($_loop=$this->_tpl_vars['listaudiocategories']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['o']['show'] = true;
$this->_sections['o']['max'] = $this->_sections['o']['loop'];
$this->_sections['o']['step'] = 1;
$this->_sections['o']['start'] = $this->_sections['o']['step'] > 0 ? 0 : $this->_sections['o']['loop']-1;
if ($this->_sections['o']['show']) {
    $this->_sections['o']['total'] = $this->_sections['o']['loop'];
    if ($this->_sections['o']['total'] == 0)
        $this->_sections['o']['show'] = false;
} else
    $this->_sections['o']['total'] = 0;
if ($this->_sections['o']['show']):

            for ($this->_sections['o']['index'] = $this->_sections['o']['start'], $this->_sections['o']['iteration'] = 1;
                 $this->_sections['o']['iteration'] <= $this->_sections['o']['total'];
                 $this->_sections['o']['index'] += $this->_sections['o']['step'], $this->_sections['o']['iteration']++):
$this->_sections['o']['rownum'] = $this->_sections['o']['iteration'];
$this->_sections['o']['index_prev'] = $this->_sections['o']['index'] - $this->_sections['o']['step'];
$this->_sections['o']['index_next'] = $this->_sections['o']['index'] + $this->_sections['o']['step'];
$this->_sections['o']['first']      = ($this->_sections['o']['iteration'] == 1);
$this->_sections['o']['last']       = ($this->_sections['o']['iteration'] == $this->_sections['o']['total']);
?>
                        <li><a href="<?php echo $this->_tpl_vars['baseurl']; ?>
/browse/categories/audios/z/<?php echo $this->_tpl_vars['listaudiocategories'][$this->_sections['o']['index']]['CATID']; ?>
/1/<?php echo ((is_array($_tmp=$this->_tpl_vars['listaudiocategories'][$this->_sections['o']['index']]['name'])) ? $this->_run_mod_handler('stripslashes', true, $_tmp) : stripslashes($_tmp)); ?>
"><?php echo ((is_array($_tmp=$this->_tpl_vars['listaudiocategories'][$this->_sections['o']['index']]['name'])) ? $this->_run_mod_handler('stripslashes', true, $_tmp) : stripslashes($_tmp)); ?>
</a></li>
                    <?php endfor; endif; ?>
                </ul>
            </div>
            <div class="sky_ad">
                <center>
                    <?php require_once(SMARTY_CORE_DIR . 'core.run_insert_handler.php');
echo smarty_core_run_insert_handler(array('args' => array('name' => 'get_advertisement', 'value' => 'var', 'AID' => '2')), $this); ?>

                </center>
            </div>
        </div>

        <div class="right col1">
            <?php if (count($this->_tpl_vars['userPlaylists']) > '0' && $this->_tpl_vars['userID'] != ''): ?>
                <form method="POST" action="<?php echo $this->_tpl_vars['formAction']; ?>
" id="playlistForm" name="playlistForm">
                <?php endif; ?>       
                <div class="cat_box_full clearfix" id="browse_main"> 
                    <table width="100%" cellspacing="3" cellpadding="3" border="0">
                        <tr>
                            <td valign="top">
                                <h2><?php echo $this->_tpl_vars['showtitle']; ?>
</h2>
                                <div class="uerror" id="audioError">Error: Please select atleast one audio to add to the playlist.</div>
                            </td>
                        </tr>
                        <?php if ($this->_tpl_vars['PlaylistMsg'] != ""): ?>
                            <tr>
                                <td>
                                    <div id="smsg" class="errorPage clearfix" style="">
                                        <h2 style="font-size:18px"><?php echo $this->_tpl_vars['PlaylistMsg']; ?>
</h2>
                                    </div>
                                </td>
                            </tr>
                        <?php endif; ?> 
                    </table>	

                    <div class="cat_body_full clearfix">

                        <?php if ($this->_tpl_vars['error'] != ""): ?>
                            <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "show_error.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
                        <?php endif; ?>
                        <?php if ($this->_tpl_vars['showmessage'] != ""): ?>
                            <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "show_message.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
                        <?php endif; ?>

                        <div id="browse_results">
                            <ul>
                                <?php unset($this->_sections['i']);
$this->_sections['i']['name'] = 'i';
$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['listaudios']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['i']['show'] = true;
$this->_sections['i']['max'] = $this->_sections['i']['loop'];
$this->_sections['i']['step'] = 1;
$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
if ($this->_sections['i']['show']) {
    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
    if ($this->_sections['i']['total'] == 0)
        $this->_sections['i']['show'] = false;
} else
    $this->_sections['i']['total'] = 0;
if ($this->_sections['i']['show']):

            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
?>
                                    <li class="video">
                                        <div class="video_i">
                                            <a href="<?php echo $this->_tpl_vars['baseurl']; ?>
/audios/<?php echo $this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['AUDIOID']; ?>
/<?php require_once(SMARTY_CORE_DIR . 'core.run_insert_handler.php');
echo smarty_core_run_insert_handler(array('args' => array('name' => 'get_seotitle_from_audioid', 'assign' => 'title', 'audioid' => $this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['AUDIOID'])), $this); ?>
">
                                            <?php ob_start(); ?>images/audiothumbs/<?php echo $this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['AUDIOID']; ?>
-1<?php echo $this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['ext'];  $this->_smarty_vars['capture']['default'] = ob_get_contents();  $this->assign('player', ob_get_contents());ob_end_clean(); ?> 
                                            <?php if (((is_array($_tmp=$this->_tpl_vars['player'])) ? $this->_run_mod_handler('file_exists', true, $_tmp) : file_exists($_tmp))): ?>
                                                <img class="imag" height="87" width="116" alt="<?php echo ((is_array($_tmp=$this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['title'])) ? $this->_run_mod_handler('stripslashes', true, $_tmp) : stripslashes($_tmp)); ?>
" src="<?php echo $this->_tpl_vars['athumburl']; ?>
/<?php echo $this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['AUDIOID']; ?>
-1<?php echo $this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['ext']; ?>
" />
                                            <?php else: ?>
                                                <img class="imag" height="87" width="116" alt="<?php echo ((is_array($_tmp=$this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['title'])) ? $this->_run_mod_handler('stripslashes', true, $_tmp) : stripslashes($_tmp)); ?>
" src="<?php echo $this->_tpl_vars['athumburl']; ?>
/default.png" />
                                            <?php endif; ?>
                                                                                        <?php if ($this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['featured'] == '1'): ?> 
                                                <div class="tag"><span class="featured">featured</span></div>
                                            <?php endif; ?>
                                        </a>
                                        <a href="<?php echo $this->_tpl_vars['baseurl']; ?>
/audios/<?php echo $this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['AUDIOID']; ?>
/<?php require_once(SMARTY_CORE_DIR . 'core.run_insert_handler.php');
echo smarty_core_run_insert_handler(array('args' => array('name' => 'get_seotitle_from_audioid', 'assign' => 'title', 'audioid' => $this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['AUDIOID'])), $this); ?>
">
                                            <span class="artist_name"><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['title'])) ? $this->_run_mod_handler('stripslashes', true, $_tmp) : stripslashes($_tmp)))) ? $this->_run_mod_handler('truncate', true, $_tmp, 15, "...", true) : smarty_modifier_truncate($_tmp, 15, "...", true)); ?>
</span>
                                            <span class="song_name"><?php if ($this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['artist'] != ""):  echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['artist'])) ? $this->_run_mod_handler('stripslashes', true, $_tmp) : stripslashes($_tmp)))) ? $this->_run_mod_handler('truncate', true, $_tmp, 15, "...", true) : smarty_modifier_truncate($_tmp, 15, "...", true));  else: ?>Anonymous<?php endif; ?></span>
                                        </a>
                                        <?php if (count($this->_tpl_vars['userPlaylists']) > '0' && $this->_tpl_vars['userID'] != ''): ?>   
                                            <span><input type="checkbox" name="audios[]" id="<?php echo $this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['AUDIOID']; ?>
" value="<?php echo $this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['AUDIOID']; ?>
" /> Add to playlist</span>
                                            <?php endif; ?>
                                    </div>
                                    </il>
                                <?php endfor; endif; ?>	
                        </ul>
                    </div> 
                </div>

                <div class="paginate">
                    <?php echo $this->_tpl_vars['pagelinks']; ?>

                </div>
            </div>
            <?php if (count($this->_tpl_vars['userPlaylists']) > '0' && $this->_tpl_vars['userID'] != '' && count($this->_tpl_vars['listaudios']) > '0'): ?>
                <br />
                <div class="cat_box_full clearfix" id="browse_main"> 
                    <h2 style="padding-bottom:10px;">Playlists</h2>
                    <div class="uerror" id="playlistError">Error: Please select atleast one playlist to add audios to.</div>
                    <?php unset($this->_sections['i']);
$this->_sections['i']['name'] = 'i';
$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['userPlaylists']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['i']['show'] = true;
$this->_sections['i']['max'] = $this->_sections['i']['loop'];
$this->_sections['i']['step'] = 1;
$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
if ($this->_sections['i']['show']) {
    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
    if ($this->_sections['i']['total'] == 0)
        $this->_sections['i']['show'] = false;
} else
    $this->_sections['i']['total'] = 0;
if ($this->_sections['i']['show']):

            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
?>
                        <div style="float:left;width:25%;">
                            <input type="checkbox" name="playlist[]" id="<?php echo $this->_tpl_vars['userPlaylists'][$this->_sections['i']['index']]['id']; ?>
" value="<?php echo $this->_tpl_vars['userPlaylists'][$this->_sections['i']['index']]['id']; ?>
" />&nbsp;
                            <?php echo ((is_array($_tmp=$this->_tpl_vars['userPlaylists'][$this->_sections['i']['index']]['title'])) ? $this->_run_mod_handler('truncate', true, $_tmp, 15, "...", true) : smarty_modifier_truncate($_tmp, 15, "...", true)); ?>

                        </div>
                    <?php endfor; endif; ?>
                    <div class="clear"></div>
                    <div>
                        <br />
                        <button id="addtoplaylist" name="addtoplaylist" type="submit" onCLick="return checkForm();">Add to playlist</button>
                    </div>
                </div>
            </form>
            <div class="cat_box_full clearfix" id="browse_main">        
                <h2 style="padding-bottom:10px;">Create new playlist</h2>
                <?php if ($this->_tpl_vars['errorPlaylist'] != ""): ?>
                    <div id="smsg" class="errorPage clearfix" style="">
                        <h2 style="font-size:18px"><?php echo $this->_tpl_vars['errorPlaylist']; ?>
</h2>
                    </div>

                <?php endif; ?> 
                <form name="create_playlist" id="create_playlist"  method="POST">
                    <input type="hidden" value="1" name="new_playlist" id="new_playlist" />
                    <p>
                        <label for="title">Title:&nbsp;</label>
                        <input name="playlist_title" id="playlist_title" type="text" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['playlist_title'])) ? $this->_run_mod_handler('stripslashes', true, $_tmp) : stripslashes($_tmp)); ?>
" size="30" /><br />
                    <div class="uerror" id="titleError">Error: Playlist title cannot be empty.</div>
                    </p>
                    <p>
                        <button onclick="return checkCreatePlaylist();" type="submit" name="create_button" id="addtoplaylist">Create playlist</button>
                                            </p>        
                </form>
            </div>
        <?php endif; ?>

    </div>     <div class="clear"></div>
</div>
</div>